docker run --name mysql5 \
 -v /Users/sky/other/docker/data/mysql5.5:/var/lib/mysql \
 -e MYSQL_ROOT_PASSWORD=root \
 -p 3306:3306 \
 -d mysql:5.5 \
 --character-set-server=utf8 \
 --lower_case_table_names=1


# #!/usr/bin/env sh

# basepath=$(cd `dirname $0`;pwd)
# name=mysql
# [ $1 ] && name=$1
# # echo $basepath
# # echo "name=$name"
# running=`docker ps | grep $name | awk '{print $2}'`
# stoped=`docker ps -a | grep $name | awk '{print $2}'`

# # echo $running
# # echo $stoped
# if [ $running ]
# then
#     echo "mysql 正在运行！"
#     exit
# fi

# if [ $stoped ]
# then
#     echo "mysql 重新启动！"
#     docker start $name > /dev/null 2>&1
#     exit
# fi

# docker run --name mysql \
#  -v $basepath/data/$name:/var/lib/mysql \
#  -e MYSQL_ROOT_PASSWORD=root \
#  -p 3306:3306 \
#  -d mysql:8 \
#  --character-set-server=utf8mb4 \
#  --collation-server=utf8mb4_unicode_ci \
#  --default-authentication-plugin=mysql_native_password > /dev/null 2>&1

# if [ $? != 0 ]
# then
#     echo 'mysql未能正常启动！'
# else
#     [ `docker ps | grep $name | awk '{print $2}'` ] && echo "success!\n3306：应用访问端口号"
# fi
